package com.lzh.chatnote.chat.dao;

import com.lzh.chatnote.chat.domain.entity.RoomGroup;
import com.lzh.chatnote.chat.mapper.RoomGroupMapper;
import com.lzh.chatnote.chat.service.RoomGroupService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 多人群聊会话表 服务实现类
 * </p>
 *
 * @author lzh
 * @since 2025-09-25
 */
@Service
public class RoomGroupDao extends ServiceImpl<RoomGroupMapper, RoomGroup>  {

    public RoomGroup queryById(Long id) {
        return lambdaQuery().eq(RoomGroup::getId, id).one();
    }

    public List<RoomGroup> queryBatchRoomUserByIds(List<Long> keys) {
        return lambdaQuery().in(RoomGroup::getRoomId, keys).list();
    }

    public RoomGroup queryRoomGroupByRoomId(Long roomId) {
        return lambdaQuery().eq(RoomGroup::getRoomId, roomId).one();
    }
}
